package net.lzzy.demo.repsitory;

import net.lzzy.demo.entity.Article;
import net.lzzy.demo.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;
@Transactional

public interface CommentRepository extends JpaRepository<Comment,Integer> {
    public List<Comment>findByArticleId(Integer id);
    @Modifying
    public void deleteByArticle(Article article);
}
